package action.weixin;

import org.apache.commons.lang.StringUtils;
import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

import common.impl.ServletHandleImpl;
import net.sf.json.JSONObject;
import security.MySecurityContextHandle;

public class WeixinAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	protected final ServletHandleImpl servletHandle = new ServletHandleImpl();

	public void getisopenid() {
		String wchatId = MySecurityContextHandle.getItem("wchatId");
		boolean isOpenid = false;
		if (!StringUtils.isEmpty(wchatId)) {
			isOpenid = true;
		}
		JSONObject jo = new JSONObject();
		jo.put("isOpenid", isOpenid);
		String r = jo.toString();
		servletHandle.writeToClient1(ServletActionContext.getResponse(), r);
	}

}
